import 'package:wukongimfluttersdk/model/wk_message_content.dart';

/// 自定义约定消息
class ConversationContent extends WKMessageContent{

    late String money;
    late String title;
    late String id;

    ConversationContent(){
        // 指定消息类型
        contentType = 2001;
    }

    @override
    WKMessageContent decodeJson(Map<String, dynamic> json) {
        title = readString(json, 'title');
        money = readString(json, 'money');
        id = readString(json, 'id');
        return this;
    }

    @override
    Map<String, dynamic> encodeJson() {
        return {'title': title, 'money': money, 'id': id};
    }
    // 如果需要获取可显示内容可重写

    @override
    String displayText() {
        return "[约定消息]";
    }
}
